package cate.game.role.show.heroskin;

import cate.game.role.Role;
import cate.game.role.RoleDependent;
import cate.game.role.show.msg.HeroSkinIllustrateResp;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

import java.util.*;


@NoteClass("英雄皮肤图鉴")
public class HeroSkinIllustrate extends RoleDependent {
	@NoteField(value = "英雄皮肤穿戴情况", detail = "Map<原型id，皮肤id>")
	public Map<Integer, Integer> heroSkin;

	@Override
	public void initialize(Role role) {
		super.initialize(role);
		if (heroSkin == null) {
			heroSkin = new HashMap<>();
		}
	}

	public void onSkin(int protoId,int skin){
		heroSkin.put(protoId, skin);
	}

	public int getHeroSkin(int protoId){
		return heroSkin.getOrDefault(protoId, 0);
	}

	private void noticeUpdate(){
		role.sendNow(new HeroSkinIllustrateResp(role));
	}
}
